import {useReducer} from 'react'

function App(props) {
  const [count, dispatch] = useReducer(v => v + 1, 0)
  return <div className='border fn-box'>
    {/* 以现有的例子，不能实现下面这一行 */}
    {/* <p className='fn-content'>函数组件，参数: name={props.name}</p> */}
    <p className='fn-content'>{props.name}</p>
    <button onClick={() => {
      dispatch()
    }}>count:{count}</button>
  </div>
}

export default App;
